<?php
include_once "../common/header.php";
?>
<script type="text/javascript">
	function update_chat()
	{
		var chatdiv = document.getElementById("chatbox");
		var newcontent = document.createElement('div');
		newcontent.innerHTML = '<p style="color:blue">You: ' + document.chat_input.chat_text.value + '</p>';
		
		while (newcontent.firstChild) {
			chatdiv.appendChild(newcontent.firstChild);
		}
		
		document.chat_input.chat_text.value = null;
		return false;
	}
</script>
<h2>CSC 360 - Quiz 1</h2>
<h3>Chatting with Craig Richardson</h3>
<table width="100%" valign="bottom">
	<tr>
		<td width="30%">
			<img src="craig.jpg" width="100%">
		</td>
		<td width="70%">
			<div style="width:95%; text-align:left; padding:5px 10px; border: 1px solid #000;">
				<table width="100%" valign="middle">
					<tr>
						<td>Craig Richardson<br/>
							V00111111<br />
							July 26 16:03<br /></td>
						<td>142.104.211.37<br />
							Victoria, BC</td>
						<td><strong><span style="color:green;">75%</span></strong></td>
						<td><a href="../ta_observe/index.php">Observe</a></td>
						<td><a href="../ta_notes/index.php">Notes</a></td>
					</tr>
				</table>
			</div>
		</td>
	</tr>
</table>

<p><strong>This chat will be recorded and included with the quiz results.</strong></p>
<div id="chatbox" style="width 80%; text-align:left; padding: 10px; border: 2px solid #000;">
	<p style="color:#666;">*** Craig has joined the chat ***</p>
	<p style="color:green;">Craig: What is the answer to question 5?</p>
</div><br /><br />
<form id="chat_input" name="chat_input" onsubmit="return update_chat();">
	<table width="100%" valign="middle">
		<tr>
			<td width="80%"><input style="border:2px solid #000; width:90%;" type="text" id="chat_text" name="chat_text" /></td>
			<td><input type="submit" class="fancybutton" value="Send" /></td>
		</tr>
	</table>
</form>
<br /><br />
<p style="clear:both;">In a real-world scenario, this chat would update with the student's replies.</p>


<center>
<form action="../ta_quiz/index.php">
	<input type="submit" class="fancybutton" value="Return to quiz 1" />
</form>
</center>

<?php
include_once "leftcol.php";
include_once "rightcol.php";
include_once "../common/footer.php";
?>